package com.example.johnsun.mytestapp.activity;


import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;

import com.example.johnsun.mytestapp.R;
import com.example.johnsun.mytestapp.my.utils.MyAppliacation;

import net.tsz.afinal.FinalActivity;
import net.tsz.afinal.annotation.view.ViewInject;

import sun.curriculumschedule.LessonScheduleActivity;


public class MainActivity extends FinalActivity {

    public static String SYS_PATH = Environment.getExternalStorageDirectory().getPath()+"/XingYuan/data/errorlog";

    @ViewInject(id= R.id.button, click ="myClick")  Button paint;
    @ViewInject(id=R.id.button2,click = "myClick") Button button1;
    private Button test;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.start_select_layout);
//        test.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                Log.i("报错","");
//            }
//        });
        WindowManager mWMgr =
                (WindowManager) MyAppliacation.maPP.getSystemService(Context.WINDOW_SERVICE);
        int width = mWMgr.getDefaultDisplay().getWidth();
        int height = mWMgr.getDefaultDisplay().getHeight();


        Configuration config = getResources().getConfiguration();
        int smallestScreenWidth = config.smallestScreenWidthDp;




        String printtext= config.screenWidthDp + "   " + config.screenHeightDp + "   " + config.densityDpi;


       // textView= (TextView) findViewById(R.id.texView_choice4_fragment);
        button1.setText("displayWidth  "+width+ "  displayHeight  "+height +" smallestScreenWidth "+smallestScreenWidth+"  设备信息  "+printtext);


    }

    public void myClick(View view){
        switch (view.getId()){
            case  R.id.button:
            startActivity(new Intent(MainActivity.this, LessonScheduleActivity.class));
//                Intent intent =new Intent(this, MyService.class);
//                startService(intent);
               // TestDownloadTask.testSomething();

                break;
            case  R.id.button2:
              startActivity(new Intent(MainActivity.this, CustomUI.class));

                break;


        }

    }

}
